<!DOCTYPE HTML>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>upm.io</title>
        <link rel="stylesheet" href="assets/css/bootstrap.min.css" />
        <link rel="stylesheet" href="assets/css/main.css" />
    </head>
    <body class="page-intranet" data-page="intranet">
        <?php include("common-tpl/topnav.php") ?>
        <?php include("common-tpl/topstatus.php") ?>
        
        <div class="container ptm pbm">
            <!-- <div class="col-md-2">
                <div class="clearfix">
                    <div class="fn-left">
                        <h4>资源池管理</h4>
                    </div>
                </div>
                <table class="table table-bordered">
                    <tr>
                      <td>主机池管理</td>
                    </tr>
                    <tr>
                      <td><a href="pool-list.php">主机池列表</a></td>
                    </tr>
                    <tr>
                      <td><a href="javascript:void(0)">主机提供源</a></td>
                    </tr>
                </table>
                <table class="table table-bordered">
                    <tr>
                      <td>网络池规划</td>
                    </tr>
                    <tr class="active">
                      <td><a href="intranet-plan.php">内网规则</a></td>
                    </tr>
                    <tr>
                      <td><a href="extranet-plan.php">外网规则</a></td>
                    </tr>
                </table>
            </div> -->
            <div class="col-md-12">
                
                <div class="row pbl">
                    <div class="col-md-12">
                        
                        <div class="bg-gray mtsm mbsm">
                            <button class="btn btn-default" type="button" id="addIntr">
                                <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                                添加
                            </button>
                            <button id="delete_popbtn" class="btn btn-default" type="button">
                                <span class="glyphicon glyphicon-minus" aria-hidden="true"></span>
                                删除
                            </button>
                        </div>

                        <table id="intranet_list" class="table table-bordered">
                            <thead>
                                <tr>
                                    <td><input class="checked_all mrs" id="checked_all" type="checkbox"><label for="checked_all">全选</label></td>
                                    <td>序号</td>
                                    <td>IP地址</td>
                                    <td>网关</td>
                                    <td>容器地址池</td>
                                    <td>分配状态</td>
                                    <td>展开</td>
                                </tr>
                            </thead>
                            <tbody></tbody>

                            <script type="text/x-jquery-tmpl" id="intranetListTemplate">
                                <tr>
                                    <td><input data-pot_ip="${pot_ip}" class="form_checkbox mrs" type="checkbox"></td>
                                    <td>${index}</td>
                                    <td>${pot_ip}</td>
                                    <td>${gateway}</td>
                                    <td>${cotainer_ips.ip_addr}/${cotainer_ips.prefix}</td>
                                    <td>${alloced_cn}</td>
                                    <td>
                                        <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="" data-toggle="dropdown" aria-expanded="true">
                                            <span aria-hidden="true" class="glyphicon glyphicon-triangle-bottom"></span>
                                        </button>
                                    </td>
                                </tr>
                            </script>
                        </table>

                        <nav>
                            
                        </nav>
                    </div>
                    
                </div>
            </div>
        </div>


        <div class="modal fade" id="addIntranet" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">内网规则</h4>
                    </div>
                    <div class="modal-body">
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="panel panel-default">
                                        <div class="panel-body">
                                            <form class="form-horizontal" id="addIntranetForm">
                                                <table id="" class="table table-bordered">
                                                    <thead>
                                                        <tr>
                                                            <td>IP地址</td>
                                                            <td>网关</td>
                                                            <td>容器地址池</td>
                                                            <td>&nbsp;</td>
                                                        </tr>
                                                    </thead>
                                                    <tfoot>
                                                        <tr>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td>
                                                                <button type="button" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
                                                            </td>
                                                        </tr>
                                                    </tfoot>
                                                    <tbody>
                                                    </tbody>
                                                </table>


                                                <script type="text/x-jquery-tmpl" id="intTemplate">
                                                    <tr>
                                                        <td>
                                                            <div class="row">
                                                                <div class="col-xs-7"><input value="${val_0}" type="text" name="potip_addr" class="form-control input-sm potip_addr" /></div>
                                                                <div class="pull-left">/</div>
                                                                <div class="col-xs-4"><input value="${val_1}" type="text" name="pot_prefix" class="form-control input-sm pot_prefix" /></div>
                                                            </div>
                                                        </td>
                                                        <td>
                                                            <input value="${val_2}" type="text" name="pot_gateway" class="form-control input-sm gateway" />
                                                        </td>
                                                        <td>
                                                            <div class="row">
                                                                <div class="col-xs-7"><input value="${val_3}" type="text" name="caip_network" class="form-control input-sm caip_network" /></div>
                                                                <div class="pull-left">/</div>
                                                                <div class="col-xs-4"><input value="${val_4}" type="text" name="ca_prefix" class="form-control input-sm ca_prefix" /></div>
                                                            </div>
                                                        </td>
                                                        <td>
                                                            <div class="btn_bar">
                                                                <button type="button" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-copy" aria-hidden="true"></span></button>
                                                                <button type="button" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-paste" aria-hidden="true"></span></button>
                                                                <button type="button" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button>
                                                                <button type="button" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-minus" aria-hidden="true"></span></button>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </script>
                                                        

                                                <div class="form-group">
                                                    <div class="col-sm-12">
                                                        <button id="submit1" class="btn btn-primary" type="button">Submit</button>
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div><!-- /.container -->
                    </div>
                </div>
            </div>
        </div>
        
        <div class="modal fade" id="delete_intranet" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">删除Pool</h4>
                    </div>
                    <div class="modal-body">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="delete_list_wrap">
                                    <table id="delete_pool_list" class="table table-bordered">
                                        <tbody>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="clearfix pbm">
                                    <button id="delete_btn" class="btn btn-default" type="button">
                                        <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
                                        删除
                                    </button>
                                    <button id="cancel_btn" class="btn btn-default" type="button">
                                        取消
                                    </button>
                                </div>
                                <script type="text/x-jquery-tmpl" id="intranetDeleteTemplate">
                                    <tr>
                                        <td>内网地址池:</td>
                                        <td><span data-pot_ip="${pot_ip}">${pot_ip}</span></td>
                                    </tr>
                                </script>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <?php include("common-tpl/bottomtpl.php") ?>
        
        <script src="assets/js/seajs/sea.js"></script>
        <script type="text/javascript">
            seajs.use('seajs/compass.js');
        </script>
    </body>
</html>
